package com.mrd.gtimpframe.repository;

import com.mrd.gtimpframe.entity.User;

import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface UserMapper {
    int deleteByPrimaryKey(String uId);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(String uId);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    User selectByAccount(String account);

    /**
     * 根据报关单id和角色查询用户信息
     *
     * @param did  报关单id
     * @param role 用户在报关单中的角色
     */
    User selectByDidAndRole(@Param("did") String did, @Param("role") String role);

    void insertRole(String userId, String roleId);

    /**
     * 角色转换
     * @author han
     * @param map
     */
    void changeUserRole(Map map);

    List<User> selectByCompany(String comId);

    int deleteRole(@Param("userId") String userId, @Param("roleId")String role);
}
